Skip to content

Define our own assert implementation for the swift compiler sources #61095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 14, 2022

Conversation

eeckstein
Copy link
Contributor

For two reasons:

  • We also like to check for assert failures in release builds. Although this could be achieved with precondition, it's easy to forget about it and use assert instead.
  • We need to see the error message in crashlogs of release builds. This is even not the case for precondition.

Also, consistently use assert instead of precondition.

For two reasons:
* We also like to check for assert failures in release builds. Although this could be achieved with `precondition`, it's easy to forget about it and use `assert` instead.
* We need to see the error message in crashlogs of release builds. This is even not the case for `precondition`.

Also, re-export the "Basic" module in "SIL" so that the new assert implementation is also available in the Optimizer module (where all files import SIL).
…ion`

It's better to use the new assert implementation (defined in the "Basic" module) than Swift's `precondition`
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

@eeckstein eeckstein merged commit 2242a3e into swiftlang:main Sep 14, 2022
@eeckstein eeckstein deleted the new-assert branch September 14, 2022 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant